<?php
class Back_Form_Tournois extends Jnd_Form
{

    public function __construct( $decorateur = "Formulairejndpro", $options = null )
    {
        parent::__construct($decorateur, $options);
        $this->setElementDecorators(array(
            "$decorateur"
        ), array(), false);
    }

    public function init()
    {
        $this->setName("tournois");
        $this->setMethod("post");
        $this->addAttribs(array(
            "class" => "cssform"
        ));
        
        $champ = new Zend_Form_Element_Hidden("id");
        $champs[] = $champ;
        
        $champ = new Zend_Form_Element_Text("nom");
        $champ->setLabel(__("Nom"));
        $champ->setRequired(true);
        $champs[] = $champ;
        
        $champ = new Jnd_Form_Element_DatePicker("date");
        $champ->setLabel(__("Date du tournoi"));
        $champ->setAttribs(array(
            "changeYear" => true, 
            "changeMonth" => true, 
            "numberOfMonths" => 3, 
            "showButtonPanel" => true, 
        ));
        $champs[] = $champ;
        
        $champ = new Zend_Form_Element_Text("heure");
        $champ->setLabel(__("Heure de début"));
        $champ->setRequired(true);
        $champs[] = $champ;
        
        $champ = new Zend_Form_Element_Text("lieu");
        $champ->setLabel(__("Lieu du tournoi"));
        $champ->setRequired(true);
        $champs[] = $champ;
        
        $champ = new Zend_Form_Element_Checkbox("ouvert");
        $champ->setLabel(__("Ouvert à l'inscription"));
        $champ->setRequired(true);
        $champ->setCheckedValue("1");
        $champ->setUncheckedValue("0");
        $champs[] = $champ;
        
        $this->addElements($champs);
    }
}

